<?php

abstract class AbstractRecipientDeterminationSet implements Iterator, Countable
{
  
  /**
   * @var array
   */
  protected $rules = array();
  
  /**
   * @var integer
   */
  private $position = 0;

  function rewind ()
  {
    $this->position = 0;
  }

  function current ()
  {
    return $this->rules[$this->position];
  }

  function key ()
  {
    return $this->position;
  }

  function next ()
  {
    ++ $this->position;
  }

  function valid ()
  {
    return isset($this->rules[$this->position]);
  }

  public function getRules ()
  {
    return $this->rules;
  }

  public function count ()
  {
    return count($this->rules);
  }
}